using System;
using StructureMap;

namespace Blog.Presentation.StructureMap
{
    public static class IoC
    {
        public static T Resolve<T>()
        {
            var instance = ObjectFactory.GetInstance<T>();

            if (null != instance)
            {
                return instance;
            }
            
            throw new Exception(string.Format("Not record in container for this {0}", typeof(T)));
        }
    }
}